package com.ftg.learn.mapper2;

import com.ftg.learn.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author kangjx
 * @createTime 2022/7/28
 */
public interface Student2Mapper {

    @Select("select * from student")
    List<Student> show();

    @Select("select * from student where sno = #{sno}")
    List<Student> show1(String sno);

//    @Select("select * from student where sno = #{arg0} and sname = #{arg1}")
    @Select("select * from student where sno = #{param1} and sname = #{param2}")
    List<Student> show2(String sno,String sname);

    @Select("select * from student where sno = #{param1} and sname = #{param2.sname}")
    List<Student> show3(String sno,Student stu);

    /**
     * @select 用来执行查询
     * @Param  用来给mybatissql绑定参数别名的
     * @param sno
     * @param stu
     * @return
     */
    @Select("select * from student where sno = #{sno} and sname = #{stu.sname}")
    List<Student> show4(@Param("sno") String sno, @Param("stu")Student stu);

}
